
package com.audi.user.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "tbl_user_relation")
public class UserRelation  implements java.io.Serializable{
    
	private static final long serialVersionUID = 5454155825314635342L;
	
	
    /**
     * relationId       db_column: relation_id 
     */ 	
	
	private Long relationId;
    /**
     * userId       db_column: user_id 
     */ 	
	
	private Long userId;
    /**
     * relUserId       db_column: rel_user_id 
     */ 	
	
	private Long relUserId;
    /**
     * relUserName       db_column: rel_user_name 
     */ 	
	//@Length(max=64)
	private java.lang.String relUserName;
    /**
     * hot       db_column: hot 
     */ 	
	
	private Long hot;
    /**
     * status       db_column: status 
     */ 	
	
	private Long status;
    /**
     * demo       db_column: demo 
     */ 	
	//@Length(max=128)
	private java.lang.String demo;
    /**
     * createTime       db_column: create_time 
     */ 	
	
	private java.util.Date createTime;
	//columns END


	public UserRelation(){
	}

	public UserRelation(
		Long relationId
	){
		this.relationId = relationId;
	}

	

	public void setRelationId(Long value) {
		this.relationId = value;
	}
	
	@Id
	//@SequenceGenerator(name="user_relation_SEQ",sequenceName="seq_user_relation")
    //@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="user_relation_SEQ") 
	@GenericGenerator(name="custom-id", strategy = "identity")
    @GeneratedValue(generator="custom-id")
	@Column(name = "relation_id", unique = false, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getRelationId() {
		return this.relationId;
	}
	
	@Column(name = "user_id", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getUserId() {
		return this.userId;
	}
	
	public void setUserId(Long value) {
		this.userId = value;
	}
	
	@Column(name = "rel_user_id", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getRelUserId() {
		return this.relUserId;
	}
	
	public void setRelUserId(Long value) {
		this.relUserId = value;
	}
	
	@Column(name = "rel_user_name", unique = false, nullable = true, insertable = true, updatable = true, length = 64)
	public java.lang.String getRelUserName() {
		return this.relUserName;
	}
	
	public void setRelUserName(java.lang.String value) {
		this.relUserName = value;
	}
	
	@Column(name = "hot", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getHot() {
		return this.hot;
	}
	
	public void setHot(Long value) {
		this.hot = value;
	}
	
	@Column(name = "status", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getStatus() {
		return this.status;
	}
	
	public void setStatus(Long value) {
		this.status = value;
	}
	
	@Column(name = "demo", unique = false, nullable = true, insertable = true, updatable = true, length = 128)
	public java.lang.String getDemo() {
		return this.demo;
	}
	
	public void setDemo(java.lang.String value) {
		this.demo = value;
	}
	
	
	
	@Column(name = "create_time", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("RelationId",getRelationId())
			.append("UserId",getUserId())
			.append("RelUserId",getRelUserId())
			.append("RelUserName",getRelUserName())
			.append("Hot",getHot())
			.append("Status",getStatus())
			.append("Demo",getDemo())
			.append("CreateTime",getCreateTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getRelationId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof UserRelation == false) return false;
		if(this == obj) return true;
		UserRelation other = (UserRelation)obj;
		return new EqualsBuilder()
			.append(getRelationId(),other.getRelationId())
			.isEquals();
	}
}

